package com.craigcmiller.cmtetris.core;

import java.awt.Color;


/**
 * Single cell on tetris board
 * @author craig
 */
public class Cell
{
	public enum CellState { empty, imaterial, set };
	
	private CellState cellState;
	private Color color;
	
	
	/**
	 * Construct a cell
	 * @param cellState
	 */
	public Cell(CellState cellState, Color color)
	{
		this.cellState=cellState;
		this.color=color;
	}
	
	
	/**
	 * Set the cell state
	 * @param cellState
	 */
	public void setCellState(CellState cellState)
	{
		this.cellState=cellState;
	}
	
	
	/**
	 * Get the cell state
	 * @return
	 */
	public CellState getCellState()
	{
		return cellState;
	}
	
	
	/**
	 * Get the color of the cell
	 * @return
	 */
	public Color getCellColor()
	{
		return color;
	}
	
	
	/**
	 * Set the cell color
	 * @param c
	 */
	public void setCellColor(Color c)
	{
		this.color=c;
	}
	
	
	/**
	 * Take the properties of another cell
	 * @param c
	 */
	public void copyPropertiesFromCell(Cell c)
	{
		this.cellState=c.cellState;
		this.color=c.color;
	}
	
	
	/**
	 * Return a character representation of this cell
	 */
	@Override
	public String toString()
	{
		if (this.cellState==CellState.empty) return "_";
		else if (this.cellState==CellState.set) return "O";
		
		return "E";
	}
}
